import React, { useState, useEffect } from "react";

const TestSetInterval: React.FC = () => {
  const [count, setCount] = useState(0);

  useEffect(() => {
    const timer = setInterval(() => {
      console.log(count);
      setCount(count + 1);
    }, 1000);

    return () => {
      clearInterval(timer);
    };
  }, []);

  console.log("Count is ", count);

  return null;
};
export default TestSetInterval;
